package com.ihg.hiex.admin.dao.data;

import java.util.List;

import com.demo2do.core.persistence.annotation.Dao;
import com.demo2do.core.persistence.annotation.Query;
import com.demo2do.core.persistence.annotation.Variable;
import com.ihg.hiex.entity.data.conference.ConferenceRoom;
import com.ihg.hiex.entity.data.conference.Type;

/**
 *
 * @author Ark
 *
 */
@Dao("hibernate")
public interface ConferenceRoomDao {

    /**
     * list conferenceRoom by type
     * 
     * @param type
     * @return
     */
    @Query("FROM ConferenceRoom WHERE disabled = false AND type = :type")
    public List<ConferenceRoom> list(@Variable("type") Type type);
    
    /**
     * 
     * @param type
     * @param maxCount
     * @return
     */
    @Query("FROM ConferenceRoom WHERE disabled = false AND type = :type AND maxCount > :maxCount")
    public List<ConferenceRoom> list(@Variable("type") Type type, @Variable("maxCount") int maxCount);
    
    /**
     * @param name
     * @param type
     * @return
     */
    @Query("FROM ConferenceRoom WHERE disabled = false AND name = :name AND type = :type")
    public ConferenceRoom load(@Variable("name") String name, @Variable("type") Type type);
    
}
